import axios from 'axios'
import store from '@/store'

const request = axios.create({

  baseURL: 'http://120.24.171.137:1337/',
  timeout: 5000
})

//  请求拦截
request.interceptors.request.use(config => {
  if (store.getters.token) {
    config.headers.Authorization = `Bearer ${store.getters.token}`
  }
  return config
})

export default request

